package com.bluefox.jpa.model;

import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.Optional;

/**
 * @ClassName : AbstractAuditDto  //类名
 * @Description : //描述
 * @Author : sunfeng
 * @Date: 2020-04-16 22:23  //时间
 */

public class AbstractAuditDto {

    private  Long id;

    private String createdBy;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdDate;

    private String lastModifiedBy;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastModifiedDate;


    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(Optional<String> createdBy) {
        this.createdBy = createdBy.get();
    }

    public LocalDateTime getCreatedDate() {
        return this.createdDate;
    }

    public void setCreatedDate(Optional<LocalDateTime> createdDate) {
        this.createdDate = createdDate.get();
    }

    public String getLastModifiedBy() {
        return lastModifiedBy;
    }

    public void setLastModifiedBy(Optional<String> lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy.get();
    }

    public LocalDateTime getLastModifiedDate() {
        return this.lastModifiedDate;
    }

    public void setLastModifiedDate(Optional<LocalDateTime> lastModifiedDate) {
        this.lastModifiedDate = lastModifiedDate.get();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

}
